package cqrtplm.vo;

import cn.hutool.core.map.MapUtil;
import com.hustcad.plm.pdm.partbom.dto.PartBomTree;
import lombok.Data;

import java.math.BigInteger;
import java.util.Date;
import java.util.Map;

/**
 * @description: EBOM详情实体类
 * @author: zhengxiong.jiang
 * @createDate: 2025-07-16
 * @version: 1.0
 */
@Data
public class EbomInfoVO {

    //订单号
    private String orderNumber;
    //订单项次
    private String orderItemSequence;
    //订单日期
    private Date orderDate;
    //开发令
    private String devCode;
    //公司机型
    private String productType;
    //推荐级别
    private String priority;
    //描述
    private String eBomDescr;
    //需小批 是/否
    private String needBatch;
    //半BOM 是/否
    private String halfBOM;
    //是否已批量
    private String SFBatch;
    //样机 是/否
    private String modelMachine;
    //测试要求
    private String testRequire;
    //认证要求
    private String certificationRequire;
    //备注
    private String fDescription;

    //公司备案机型*
    private String companyModel;
    //客户备案机型*
    private String customerModel;
    //小批数量*
    private Integer smallBatchQuantity;
    //开发项目*
    private String developmentProject;

    //段号
    private String segmNum;
    //装配位置
    private String position;
    //零部件名称*
    private String partName;
    //物料编码*
    private String materialCode;
    //数量*
    private Integer quantity;
    //物料描述
    private String describe;
    //部装编码*
    private String assemblyCode;
    //历史描述*
    private String historyDesc;
    //认证类型*
    private String certificationType;
    //类型*
    private String type;
    //ROHS差价*
    private String rohsPriceDiff;

    //创建人
    private String createName;
    //创建时间
    private String createTime;
    private String fatherOid;
    private String fatherOtype;
    private String fatherNumber;

    //EBOM层级 0父级 1子级
    private String level;

    public EbomInfoVO() {

    }

    public EbomInfoVO(PartBomTree partBomTree, Map<String,String> map) {
        this.createName = partBomTree.getCreateName()==null?"":partBomTree.getCreateName();
        this.createTime = partBomTree.getCreateTime()==null?"":partBomTree.getCreateTime();
        this.fatherOid = partBomTree.getPartoid()==null?"":partBomTree.getPartoid();
        this.fatherOtype = partBomTree.getPartotype()==null?"":partBomTree.getPartotype();
        this.fatherNumber = partBomTree.getMasterpartnumber()==null?"":partBomTree.getMasterpartnumber();
        this.devCode = map.get("devCode")==null?"":map.get("devCode");
        this.productType = map.get("productType")==null?"":map.get("productType");
        this.priority = map.get("RecommendLevel")==null?"":map.get("RecommendLevel");
        this.eBomDescr = partBomTree.getDescription()==null?"":partBomTree.getDescription();
        this.needBatch = map.get("NeedBatch")==null?"":map.get("NeedBatch");
        this.halfBOM = map.get("HalfBOM")==null?"":map.get("HalfBOM");
        this.SFBatch = map.get("SFBatch")==null?"":map.get("SFBatch");
        this.modelMachine = map.get("ModelMachine")==null?"":map.get("ModelMachine");
        this.testRequire = map.get("TestRequire")==null?"":map.get("TestRequire");
        this.certificationRequire = map.get("CertificationRequire")==null?"":map.get("CertificationRequire");
        this.fDescription = map.get("Remark")==null?"":map.get("Remark");
        this.companyModel = map.get("companyModel")==null?"":map.get("companyModel");
        this.customerModel = map.get("customerModel")==null?"":map.get("customerModel");
        if(map.get("smallBatchQuantity")!=null){
            this.smallBatchQuantity = Integer.valueOf(map.get("smallBatchQuantity"));
        }else {
            this.smallBatchQuantity = 0;
        }
        this.developmentProject = map.get("developmentProject")==null?"":map.get("developmentProject");
        this.segmNum = map.get("SegmNum")==null?"":map.get("SegmNum");
        this.position = partBomTree.getAssemblyMode()==null?"":partBomTree.getAssemblyMode();
        this.partName = map.get("partName")==null?"":map.get("partName");
        this.materialCode = map.get("materialCode")==null?"":map.get("materialCode");
        if(map.get("quantity")!=null){
            this.quantity = Integer.valueOf(map.get("quantity"));
        }else {
            this.quantity = 0;
        }
        this.describe = partBomTree.getDescription()==null?"":partBomTree.getDescription();
        this.assemblyCode = map.get("assemblyCode")==null?"":map.get("assemblyCode");
        this.historyDesc = map.get("historyDesc")==null?"":map.get("historyDesc");
        this.certificationType = map.get("certificationType")==null?"":map.get("certificationType");
        this.type = map.get("type")==null?"":map.get("type");
        this.rohsPriceDiff = map.get("rohsPriceDiff")==null?"":map.get("rohsPriceDiff");
        this.level = partBomTree.getLevel()==null?"":partBomTree.getLevel();
    }


}
